package com.zut.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zut.mapper.UserMapper;
import com.zut.pojo.User;
import com.zut.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService{
	
	@Autowired
	private UserMapper userMapper;

	@Override
	public int insertUser(User user) {
		int flag = userMapper.insertUser(user);
		return flag;
	}

	@Override
	public int deleteUser(int id) {
		int flag = userMapper.deleteUserById(id);
		return flag;
	}

	@Override
	public int updateUserById(User user) {
		int flag = userMapper.updateUserById(user);
		return flag;
	}

	@Override
	public List<User> findUserAll() {
		List<User> list = userMapper.findUserAll();
		return list;
	}

	@Override
	public User findUserById(int id) {
		User user = userMapper.findUserById(id);
		return user;
	}

	@Override
	public List<User> findUserByName(String username) {
		List<User> list = userMapper.findUserByName(username);
		return list;
	}
	
	
}
